package first.liter;

import first.users.*;
import java.util.List;
import java.util.ArrayList;
/**
 * Class that describes literature
 * 
 * @author Kozlov Kirill
 * @version Thu Oct 21,2010
 */
public abstract class Literature {
	
	public enum LITERATURE { BOOK, JOURNAL };
	/**
	 * Name of the literature 
	 */
	private String nameLit;
	
	/**
	 * Name of the author(establisher) 
	 */
	private String author;
	
	/**
	 * Description of the literature 
	 */
	private String desc;
	
	
	/**
	 * Library literature's language
	 */
	private String languageLit;
	
	/**
	 * Amount of pages in literature
	 */
	private Integer amountOfPages;
	
	/**
	 * Edition number of literature
	 */
	private int editNumLit;
	
	/**
	 * ID of Literature
	 */
	private Integer idLit;
	
	/**
	 * Type of literature either this Book or Journal
	 */
	private String typeOfLiterature;
	
	/**
	 * Availability of literature, is it free or not
	 */
	private Boolean availabilityOfLit;
	
	/**
	 * List of those Readers who ordered this book
	 */
	private List<BiblioUser> listUsersOrder;
	
	/**
	 * List of those readers who have read this book
	 */
	private List<BiblioUser> listUserReaded;
	
//=================================================================================================
//================================CONSTRUCTORS=====================================================
	public Literature()
	{
		this.nameLit="default";
		this.languageLit="default";
		this.typeOfLiterature="default";
		this.amountOfPages=0;
		this.availabilityOfLit=true;
		this.setListUsersOrder(new ArrayList<BiblioUser>());
		this.listUserReaded=new ArrayList<BiblioUser>();
		this.author="default";
		this.desc="";
		this.editNumLit=1;
	}

	public Literature(Literature lit)
	{
		this.amountOfPages=lit.amountOfPages;
		this.availabilityOfLit=lit.availabilityOfLit;
		this.languageLit=lit.languageLit;
		this.nameLit=lit.nameLit;
		this.typeOfLiterature=lit.typeOfLiterature;
		this.author=lit.getAuthor();
		this.desc=lit.getDesc();
		this.editNumLit=lit.getEditNumLit();
	}
	
	
//==================================================================================================
//=======================================Methods====================================================

	public String toString()
	{
		return "Name of Literature: "+this.nameLit+"<br/>"+
		"\nType of Literature: "+this.typeOfLiterature+"<br/>"+
		"\nLiterature's Language: "+this.languageLit+"<br/>"+
		"\nAuthor: "+this.author+"<br/>"+
		"\nAmount of Pages: "+this.amountOfPages+"<br/>"+
		"\nID of Literature: "+this.idLit+"<br/>"+
		"\nDescription of Literature: "+this.desc+"<br/>"+
		"\nAvailability of Literature: "+this.availabilityOfLit+"<br/>"+
		"\nNumber of Literature's Edition: "+this.editNumLit;
	}
	
	public String gettoString()
	{
		return "Name of Literature: "+this.nameLit+"<br/>"+
		"\nType of Literature: "+this.typeOfLiterature+"<br/>"+
		"\nLiterature's Language: "+this.languageLit+"<br/>"+
		"\nAuthor: "+this.author+"<br/>"+
		"\nAmount of Pages: "+this.amountOfPages+"<br/>"+
		"\nID of Literature: "+this.idLit+"<br/>"+
		"\nDescription of Literature: "+this.desc+"<br/>"+
		"\nAvailability of Literature: "+this.availabilityOfLit+"<br/>"+
		"\nNumber of Literature's Edition: "+this.editNumLit;
	}
	
	
	
	
	
	

//==================================================================================================	
//=====================================Getter&&Setters==============================================	
	/**
	 * @param nameLit the name of literature to set
	 */
	public void setNameLit(String nameBooks) {
		this.nameLit = nameBooks;
	}

	/**
	 * @return the nameLit
	 */
	public String getNameLit() {
		return nameLit;
	}

	/**
	 * @param languageLit the language of literature to set
	 */
	public void setLanguageLit(String languageBooks) {
		this.languageLit = languageBooks;
	}

	/**
	 * @return the languageLit
	 */
	public String getLanguageLit()
	{
		return this.languageLit;
	}

	/**
	 * @param amountOfPages the amountOfPages to set
	 */
	public void setAmountOfPages(Integer amountOfPages) {
		this.amountOfPages = amountOfPages;
	}

	/**
	 * @return the amountOfPages
	 */
	public Integer getAmountOfPages() {
		return amountOfPages;
	}

	public abstract int someMethod();

	/**
	 * @param typeOfLiterature the typeOfLiterature to set
	 */
	public void setTypeOfLiterature(String typeOfLiterature) {
		this.typeOfLiterature = typeOfLiterature;
	}

	/**
	 * @return the typeOfLiterature
	 */
	public String getTypeOfLiterature() {
		return typeOfLiterature;
	}


	/**
	 * @param availabilityOfLit the availabilityOfLit to set
	 */
	public void setAvailabilityOfLit(Boolean availabilityOfLit) {
		this.availabilityOfLit = availabilityOfLit;
	}


	/**
	 * @return the availabilityOfLit
	 */
	public Boolean getAvailabilityOfLit() {
		return availabilityOfLit;
	}

	/**
	 * @param listUsersOrder the listUsersOrder to set
	 */
	public void setListUsersOrder(List<BiblioUser> listUsersOrder) {
		this.listUsersOrder = listUsersOrder;
	}

	/**
	 * @return the listUsersOrder
	 */
	public List<BiblioUser> getListUsersOrder() {
		return listUsersOrder;
	}


	/**
	 * @return the listUserReaded
	 */
	public List<BiblioUser> getListUserReaded() {
		return listUserReaded;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getAuthor() {
		return author;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getDesc() {
		return desc;
	}

	public void setEditNumLit(int editNumLit) {
		this.editNumLit = editNumLit;
	}

	public int getEditNumLit() {
		return editNumLit;
	}

	public void setIdLit(Integer idLit) {
		this.idLit = idLit;
	}

	public Integer getIdLit() {
		return idLit;
	}
	
}
